In this analysis we will simulate a basket clinical trial run on patients affected by 3 diseases: breast, lung and gastric cancer. Samples will be collected and sequencing with Next-generation sequencing technology. Patients will be assigned to treatment groups based on the genomic characterization. The panel design is based on a recent publication that defines the guidelines for precision medicine and the genes that should be included into diagnostic NGS assays for the previously indicated tumor type.

Consensus on precision medicine for metastatic cancers: a report from the MAP conference C.

BASKET TRIAL PANEL SHOWCASE

OBJECTIVES

The objective of this analysis is to:

  1. Simulate the panel “detection power” (defined as the number of patients with at least one alteration detectable by the genomic panel) in different tumor types.
  2. Simulate a genomic driven clinical trial: As we might risk to have “unbalanced” group treatment, we would like to know in advance the patient allocation frequency to different treatment arms based on the alteration frequency in the cancer population;
  3. Estimate the number of patients needed to be screened;
  4. Optimize the size of the panel and therefore reduce experimental cost;
  5. As last, illustrate the usage of PTD in a concrete showcase context.

Initial assumption

The panel is designed based on the guidelines indicated in the recent publication:

Consensus on precision medicine for metastatic cancers: a report from the MAP conference C.

We had to make some adjustments and interpretations in order to fit the guidelines into a panel design that would be input by the PTD package.

Gene name adoption

PTD requires gene names to be written in HGNC format. Since the software will download data from different web databases, we need to make sure that gene names follow the international convention. While scanning the paper, we noticed that the following genes were encoded in the paper with names that do not match the HGNC standards. We have therefore apply the following interpretations and corrections:

Paper annotation Conversion for the analysis
NTKR (Possible typo?) NTRK1, NTRK2, NTRK3
NTRK NTRK1, NTRK2, NTRK3

Moreover, the paper states that for gastric tumor, MSI should be tested. We can infer this information testing the following genes: MLH3, MLH1, MSX1, MSX2

Gene alterations

In this analysis we will only consider the following alteration:

  • SNV
  • CNA
  • Fusions (only for lung tumor since they were selected to be lung cancer specific alteration)

Changes in expression are not included in this analysis.

Drug Treatment

For demonstrative purposes we are simulating a clinical trial by associating altered genes to “general drug families” as a possible treatment.

Tumor types

The paper we are basing our work on, defines the guidelines for 3 diseases:

  • Breast cancer;
  • Lung cancer;
  • Gastric Cancer;

We need to convert these diseases into tumor ID compatible with the TCGA standard. The conversion is applied as follows:

Publication definition TCGA tumor ID conversion adopted
Breast Cancer brca (Breast invasive carcinoma)
Lung Cancer luad (Lung adenocarcinoma)
Lung Cancer lusc (Lung squamous cell carcinoma)
Gastric Cancer stad (Stomach adenocarcinoma)
Gastric Cancer coadread (colon)

We are making the assumption that the cancer population of reference is composed entirely and uniquely by this cancer subtypes

# Define tumor types 
tumor_types <- c("brca", "luad", "lusc", "stad", "coadread")

Sampling Populations

In this section, we will attempt to estimate the sample size of each cancer type in a population of reference. For this simulation we will use a population of reference sampled according to the statistics published by seer.cancer.gov

Seer reports that, between 2009 and 2013 the tumor population amounted to:

  • Breast cancer: 306665 people;
  • Lung cancer: 256350 people;
  • Gastric cancer:
    • Stomach cancer: 33174 people;
    • Colon and rectum cancer: 185758 people;
Breast carcinoma

Frequency of the population is adjusted by Breast carcinoma according to the following table sect_04_table.25_2pgs.pdf:

  • brca: 99.4%
Lung subtypes

Frequency of the population is adjusted by lung tumor subtypes according to online link, local file:

  • Lung Adenocarcinoma: 45% of lung population
  • Lung squamous and transitional cells: 23.0% of lung population
Gastric subtypes

Frequency of the population is adjusted by stomach tumor subtypes according to online link, local copy

  • Stad: 82%

Frequency of the colon cancer are adjusted according to online link, local file

  • Coadread: 92.8%

We will therefore use these statistics as our population of reference using the following approximations:

set.seed(7)

# assign number of patients
luad_tot = ceiling(256350*0.45) #adjustement coefficient specific to the % of subtype tumor in a lung cancer population
lusc_tot = ceiling(256350*0.23) #adjustement coefficient 
stad_tot = ceiling(33174*0.82) #adjustement coefficient 
coadread_tot = ceiling(185758*0.928) #adjustement coefficient 
brca_tot = ceiling(306665 * 0.994)

# total
all_tot = brca_tot+luad_tot+lusc_tot+stad_tot+coadread_tot

# calculate frequencies
brca_freq = brca_tot/all_tot
luad_freq = luad_tot/all_tot
lusc_freq = lusc_tot/all_tot
stad_freq = stad_tot/all_tot
coadread_freq = coadread_tot/all_tot
TCGA tumor ID population considered frequency
brca 304826 0.449111
luad 115358 0.169961
lusc 58961 0.0868693
stad 27203 0.0400791
coadread 172384 0.2539795

ANALYSIS

In the following phases we will proceed by designing the panel and visualizing its performance through different types of plots.

Design phase

First step is to create the panel design using an excel file according to the standards of the package. The panel design is loaded into R and can be previewed in the table below.

library(DT)
library(knitr)
library(ggplot2)
library(PrecisionTrialDesigner)

# Import excel file in R
panel_design <- gdata::read.xls("../Tables/tb1_PTD_panel_showcase.xlsx")
# preview the input table
datatable(panel_design)

We can now run the main function of the R package and:

  1. Import the panel design into a CancerPanel object;
  2. download Alteration information for the drug types of interest;
  3. Adapt the alteration information to the CancerPanel design;
# 1. Create the panel Object using PTD package - DESIGN PHASE
PTD_panel <- newCancerPanel(panel_design)
# 2. DOWNLOAD PHASE
PTD_panel <- getAlterations(PTD_panel, tumor_type=tumor_types)
# 3. SIMULATION PHASE
PTD_panel <- subsetAlterations(PTD_panel)

#save a backup copy to speed up future analysis
saveRDS(PTD_panel, file="../Temp/PTD_panel.rds")

At this point PTD_panel contains all the information we need to visualize the panel performance.

Visualisation and Simulations of the panel performance

In this section we will start running some of the visualization functions to investigate how well the panel would perform in different conditions. Before starting out investigation we want to visualize the sample number by tumor type to keep in consideration any sampling bias due to the population of origin. This bias can be corrected using the option tumor.wieights or tumor.freqs.

The following table shows the number of samples (y-axis) collected for this analysis for each tumor type considered.

coverageStackPlot(PTD_panel
                  , alterationType=c("mutations" , "copynumber") 
                  , var="tumor_type", noPlot=TRUE)$Samples %>%
  data.frame(Samples=.) %>%
  tibble::rownames_to_column("tumor_type") %>%
  knitr::kable()
tumor_type Samples
brca 976
coadread 221
luad 230
lusc 178
stad 393
all_tumors 1998

Let’s export the data and make a summary table to resume different in populations:

# get data for table
tcga_pop <- coverageStackPlot(PTD_panel
                  , alterationType=c("mutations" , "copynumber") 
                  , var="tumor_type"
                  , noPlot=TRUE)

# calculate frequencies
tcga_freqs <- tcga_pop$Samples[-length(tcga_pop$Samples)]  / tcga_pop$Samples["all_tumors"]

# make it into a df
population_df <- data.frame(tumor=c("brca", "luad", "lusc", "stad", "coadread")
          , seer=c(brca_freq, luad_freq, lusc_freq, stad_freq, coadread_freq)
          , tcga = c(tcga_freqs["brca"], tcga_freqs["luad"], tcga_freqs["lusc"], tcga_freqs["stad"], tcga_freqs["coadread"])
)

# barplot, with only the genes in the panel
population_df %>%
  tidyr::gather(Population, Frequency, seer:tcga) %>%
  ggplot(aes(x=Population, y=Frequency, fill=tumor)) + 
  geom_bar(stat="identity") + 
  facet_grid(. ~ tumor, space="free", scales="free") +
  ggtitle("Comparison of the initial population composition")

library(svglite)
ggsave(filename="../Figures/fig1D.svg", plot=last_plot(), device = "svg")
## Saving 10 x 8 in image

Comparison table between SEER initial population and TCGA initial population

TCGA tumor ID Seer population considered Seer frequency 1 TCGA initial population TCGA sample frequency 2
brca 3049 0.449111 976 0.4884885
luad 1154 0.169961 230 0.1151151
lusc 590 0.0868693 178 0.0890891
stad 273 0.0400791 393 0.1966967
coadread 1724 0.2539795 221 0.1106106

Fusion detection in Lung cancer

The previous plot does not include fusions, as the fusion in the panel are specific to the lung tumor. If we want to visualize the number of samples with available information for mutations, copynumber and fusions (each patients will have information for each category).

coverageStackPlot(PTD_panel
                  , alterationType=c("mutations" , "copynumber", "fusions") 
                  , var="tumor_type"
                  , tumor_type = c("luad", "lusc")
                  )

Panel detection power in the overall population

One common question that is often considered when trying to design custom target enrichment panel, is the percentage of the population that would be “captured” by the design of the panel. The following plot shows the number of alteration (x-axis) found in the sample (patient) population (y-axis). The panel detection power can be defined as the number of patients with at least one alteration detectable by the genomic panel. In this simulation we are interested in visualizing the detection power in a population background composed by patients from breast, lung, and gastric cancer. For simplicity fusion information are not included in the analysis.

coveragePlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             # adjust population distribution by applying a weighted sampling bootstrap
             , tumor.freqs = c(brca=brca_freq
                               , luad=luad_freq
                               , lusc=lusc_freq
                               , stad = stad_freq
                               , coadread = coadread_freq
                               )
            )

The previous plot shows the percentage of patients (y-axis) found to have at least one, two, three, etc, alterations (x-axis). The current design is capable of detecting 0.77% of the population of reference.

Panel detection-power in a tumor type specific population background

In the following plot we want to identify the performance of our panel for each single tumor types starting from out population of reference composed by the 3 cancers groups.

coveragePlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             , grouping = "tumor_type"
             , tumor.weights = c(brca=brca_tot
                               , luad=luad_tot
                               , lusc=lusc_tot
                               , stad = stad_tot
                               , coadread = coadread_tot
                               )
             )

To allow and easy comparison of the detection power in different tumor types we have redesign the plots into one unique barplot.

# get data from the panel simulation
dt_power_lt <- coverageStackPlot(PTD_panel
                  , alterationType=c("mutations" , "copynumber") 
                  , var="tumor_type"
                  , noPlot = TRUE
              )

# convert to dataframe
dt_power_lt$plottedTable <- data.frame(dt_power_lt$plottedTable)

# calculate frequency
df <- data.frame()
for(i in 1:length(dt_power_lt$plottedTable)){
  
  # find tot. number of samples in matching tumor
  index <- which(names(dt_power_lt$Samples) %in% names(dt_power_lt$plottedTable[i]))
  
  if(length(index) != 0 ){
    # calculate frequency
    # freq <- dt_power_lt$plottedTable[i] / dt_power_lt$Samples[index]
    freq <- dt_power_lt$plottedTable[i] / dt_power_lt$Samples["all_tumors"]
  }
  # export
  df <- rbind(df
              , data.frame(tumor_id=names(dt_power_lt$Samples[index])
                             , freq=as.numeric(freq))
              )
}

# generate plot 
df %>%
  dplyr::arrange(freq) %>%
  ggplot(aes(x=reorder(tumor_id, freq), y=freq*100)) + 
  geom_bar(stat="identity") + 
  coord_flip() + 
  labs(title="Genomic panel detection-power in different tumor types.") +
  ylab(label = "detection power indicated as the overall population percentage") +
  xlab(label = "tumor type (TCGA ID)")

Patient treatment allocation

We can also easily address the issue of the allocation frequency in the different treatment groups. The following plot shows the number of patients with at least one, two or more alterations that can be targeted by each drug in the trial. This is particularly important in clinical trails when you want to predict the maximum number of patients that could be allocated into a drug treatment and identify potential cohorts with few patients allocated.

coveragePlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             , grouping="drug"
             # adjust population distribution by applying a weighted sampling bootstrap
             , tumor.freqs = c(brca=brca_freq
                               , luad=luad_freq
                               , lusc=lusc_freq
                               , stad = stad_freq
                               , coadread = coadread_freq
                               )
             , colNum = 2 # number of columns in the plot
             , cex.main = 1 # size of the plot title
)

To make it simpler to compare, we will plot the detection power for each drug type in a unique plot. The following code will put all the previous plot together in one unique barplot.

# get data from the panel simulation
drug_df <- coveragePlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             , grouping="drug"
             # adjust population distribution by applying a weighted sampling bootstrap
             , tumor.freqs = c(brca=brca_freq
                               , luad=luad_freq
                               , lusc=lusc_freq
                               , stad = stad_freq
                               , coadread = coadread_freq
                               )
             , colNum = 2 # number of columns in the plot
             , cex.main = 1 # size of the plot title
             , noPlot=TRUE
 )$plottedTable %>% data.frame()

# name first column with frequency of patients with at least one alteration that makes the patients elibigle for treatment with a specific drug
names(drug_df)[1] <- "freq"

# generate plot 
drug_df %>%
  tibble::rownames_to_column("drug_name") %>%
  #dplyr::add_rownames("drug_name") %>%
  ggplot(aes(x=reorder(drug_name, freq), y=freq*100)) + 
  geom_bar(stat="identity") + 
  coord_flip() + 
  labs(title="Max frequencies of patients elibigle for each drug treatment") + 
  ylab(label = "detection power indicated as the overall population percentage") +
  xlab(label = "Drug name")

Panel performance evaluation

The design phase of a panel requires the user to make the important decision about what genes to include. PTD provides a suite of tools envisioned to aid the user during the decision process and evaluate the performance of the panel.

Rank genes in the design in terms of genomic space/detection power

The following plot was studied to investigate the relationship between the “cost” of adding new genes to the panel (as a function of genomic space to be included among the genomic regions to be targeted) and the detection power in terms of the mean number of alterations found in the samples (cancer population), for that specific gene in a specific set of tumor types.

In order to optimize a panel design, we might be interested to know:

  • What genes are most altered in the tumor types of interest;
  • What genes are “cheaper” to be sequenced (in terms of genomic spaces, or also size of the targeted region);
  • What genes have the highest number of (alteration frequency) / (genomic space).
All tumors together

The following saturation plot shows the overall performance of the panel in a population that includes all tumor types of interest (balanced by tumor frequency in the population of reference). Genes can be ranked based on the ratio (alteration frequency) / (genomic space). Genes with highest mean number of alteration per sample and smallest size are listed first. The following genes in the plot are added one by one incrementally. This means that on the y-axis, every time we add a new gene, we are adding only the incremental contribution of alteration for that specific gene. This was done to prevent from counting twice (or more than once), patients with genes that were already found altered.

saturationPlot(PTD_panel
            , alterationType=c("mutations" , "copynumber")
            , adding="gene_symbol"
            # adjust population distribution by applying a weighted sampling bootstrap
            , tumor.weights=c(brca=brca_tot
                             , luad = luad_tot
                             , lusc = lusc_tot
                             , stad = stad_tot
                             , coadread = coadread_tot
                             )
            , adding.order = "rate"
            , legend = "out"
            )

Each single cancer type will have different gene alteration frequencies, and therefore the order of the genes can change accordingly. In the following set of plots we will change the gene adding order, using asbolute ranking. This parameters, will not add genes based on their optimal ratio, but will priorities genes with the absolute highest number of alterations found in each single tumor group of interest

Breast Cancer
saturationPlot(PTD_panel
            , alterationType=c("mutations" , "copynumber")
            , adding="gene_symbol"
            , tumor_type = "brca"
            , adding.order = "absolute"
            )

Lung Cancer, mutations and copy number alterations
saturationPlot(PTD_panel
            , alterationType=c("mutations" , "copynumber")
            , adding="gene_symbol"
            , tumor_type = c("luad", "lusc")
            , adding.order = "absolute"
            )

Lung Cancer, only fusion alterations
saturationPlot(PTD_panel
            , alterationType=c("fusions")
            , adding="gene_symbol"
            , tumor_type = c("luad", "lusc")
            , adding.order = "absolute"
            )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## lusc

Gastric Cancer
saturationPlot(PTD_panel
            , alterationType=c("mutations" , "copynumber")
            , adding="gene_symbol"
            , tumor_type = c("stad", "coadread")
            , adding.order = "absolute"
            )

Rank drugs in the design in terms of genomic space/patient allocation

Similarly to the previous set of plots, we can investigate the cost of adding a new drug in the study in terms of extra genomic space to be targeted by the panel with respect to the alteration frequency of population that can be captured.

saturationPlot(PTD_panel
            , alterationType=c("mutations", "copynumber")
            , adding="drug"
            , y_measure="absolute"
            , tumor.weights = c(brca=brca_tot
                               , luad=luad_tot
                               , lusc=lusc_tot
                               , stad = stad_tot
                               , coadread = coadread_tot
                               )
             
            )

Similarly, we can separate the saturation line by tumor_types. (Note: In the following plot we do not need to apply the tumor.wight option, as we are grouping by tumor_types, Note2: no_drug indicates frequency associated with driver genes which are therefore not associated to any drug treatment in this specific design).

saturationPlot(PTD_panel
            , alterationType=c("mutations", "copynumber")
            , grouping="tumor_type"
            , adding="drug"
            , y_measure="absolute"
            , legend = "out"
            )

To improve the readability of the plot, we can look at each single tumor type individually.

Breast Cancer
# Generate plots for each tumor types
saturationPlot(PTD_panel
            , alterationType=c("mutations", "copynumber")
            , grouping="tumor_type"
            , adding="drug"
            , y_measure="absolute"
            , tumor_type = "brca"
) 

Lung Cancer
saturationPlot(PTD_panel
            , alterationType=c("mutations", "copynumber")
            , grouping="tumor_type"
            , adding="drug"
            , y_measure="absolute"
            , tumor_type = c("luad", "lusc")
)

Gastric Cancer
saturationPlot(PTD_panel
            , alterationType=c("mutations", "copynumber")
            , grouping="tumor_type"
            , adding="drug"
            , y_measure="absolute"
            , tumor_type = c("coadread", "stad")
) 

Panel detection power of each alteration type in the overall population

SNV and indels detection are today part of standard analysis for NGS application.However, CNA (Copy number alteration) detection, or fusion analysis are still not standardized analysis and they do not represent an easy implementation. In the following plot we will investigate the contribution of the detection power of each alteration type in case. This will help us quantify, in case we decide to opt out the detection of some of the alteration type, the influence of each single alteration type in the detection power.

saturationPlot(PTD_panel
            , alterationType=c("mutations" , "copynumber", "fusions")
            , adding="gene_symbol"
            , tumor.weights=c(brca=brca_tot
                             , luad = luad_tot
                             , lusc = lusc_tot
                             , stad = stad_tot
                             , coadread = coadread_tot
                             )
            ,grouping="alteration_id"
            )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## stad, coadread

Drug targeting frequency plot

In case some of the drugs are multitarget (in this panel design, we are using drug families), it might be interesting to investigate what are the most targeted genes in our population of reference. We can visualize this information as an independent stack plot for each tumor type.

par(mfrow=c(3,1))
coverageStackPlot(PTD_panel
             , alterationType=c("mutations", "copynumber")
             , var="drug"
             , grouping="gene_symbol"
             , tumor_type="brca"
             )

coverageStackPlot(PTD_panel
             , alterationType=c("mutations" , "copynumber" , "fusions")
             , var="drug"
             , grouping="gene_symbol"
             , tumor_type=c("luad", "lusc")
             )

coverageStackPlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             , var="drug"
             , grouping="gene_symbol"
             , tumor_type=c("stad", "coadread")
             )

par(mfrow=c(1,1))

We can also visualize co-occurrence and mutual exclusivity

Overall Co-occurance
coocMutexPlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             #, grouping="alteration_id"
             , var="drug"
             , tumor.freqs = c(brca=brca_freq
                               , luad=luad_freq
                               , lusc=lusc_freq
                               , stad = stad_freq
                               , coadread = coadread_freq
                               )
             )

Breast cancer co-occurence plot
coocMutexPlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             #, grouping="alteration_id"
             , var="drug"
             , tumor_types= "brca"
             )

Lung cancer co-occurence plot
coocMutexPlot(PTD_panel   
             , alterationType=c("mutations" , "copynumber", "fusions" )
             #, grouping="alteration_id"
             , var="drug"
             , tumor_types= c("luad", "lusc")
             )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## stad, coadread

Gastric cancer co-occurence plot
coocMutexPlot(PTD_panel
             , alterationType=c("mutations" , "copynumber")
             #, grouping="alteration_id"
             , var="drug"
             , tumor_types= c("egc", "stad", "coadread")
             )

How many patients are eligible to more than one treatment?

# Prepare dataframe on which to run the analysis
# ------------------------------------------------------------------------------
# Extract data
data <- dataExtractor(PTD_panel , alterationType = c("mutations" , "copynumber" , "fusions"))
## Warning in dataExtractor(PTD_panel, alterationType = c("mutations",
## "copynumber", : The following tumor types have no alteration to display:
## stad, coadread
# Extract case_id and drug columns
dataDrug <- unique(data$data[ , c("case_id" , "drug")])
# calculate number of drug per patient, taking into account ALL samples
drugsPerPatient <- table( factor(dataDrug$case_id , levels = data$Samples$all_tumors) )

# Calculate the frequenecy of patients eligible to at least X number od drugs
alPatDrug <- sapply(1:max(drugsPerPatient), function(x){
          sum(drugsPerPatient >= x) / length(drugsPerPatient)
         }
       ) %>% 
  data.frame(drugs=.) 

# Plot
alPatDrug %>%
  ggplot(aes(x=1:length(drugs), y=drugs)) + 
  geom_bar(stat="identity") +
  labs(title="Patients eligible to AT LEAST 1, 2, 3 or 4 ... drugs") +
  ylab(label = "Eligibility frequency") +
  xlab(label = "Number of drugs the patient is eligible for") +
   theme(legend.position="none") + 
  geom_text(aes(label=stringr::str_c(round(drugs, digits=4)*100, " %"), colour="red", y=drugs+0.05),  position = position_dodge(width=0.9))

Power analysis

We can now simulated a clinical trail based on the drug-gene targeting design, and estimate the number of patients that would need to be recruited.

  • We will look at 4 power levels: 0.6, 0.7, 0.8, 0.9
  • and we will consider different Hazard ratios

Overall power analysis for the full study

# Generate plot
survPowerSampleSize(PTD_panel
  , HR = c(0.5, 0.6, 0.7, 0.8)
  , power = seq(0.6 , 0.9 , 0.1)
  , alpha = 0.05
  , case.fraction = 0.5
  , tumor.weights = c(brca=brca_tot
                    , luad = luad_tot
                    , lusc = lusc_tot
                    , stad = stad_tot
                    , coadread = coadread_tot
                    )
  )

# Generate Table
survPowerSampleSize(PTD_panel
  , HR = c(0.5, 0.6, 0.7, 0.8)
  , power = seq(0.6 , 0.9 , 0.1)
  , alpha = 0.05
  , case.fraction = 0.5
  , tumor.weights = c(brca=brca_tot
                    , luad = luad_tot
                    , lusc = lusc_tot
                    , stad = stad_tot
                    , coadread = coadread_tot
                    )
  , noPlot =TRUE
  ) %>% kable()
Var ScreeningSampleSize EligibleSampleSize Beta Power HazardRatio
Full Design 77 59 0.4 0.6 0.5
Full Design 96 74 0.3 0.7 0.5
Full Design 124 95 0.2 0.8 0.5
Full Design 164 126 0.1 0.9 0.5
Full Design 135 104 0.4 0.6 0.6
Full Design 169 130 0.3 0.7 0.6
Full Design 216 166 0.2 0.8 0.6
Full Design 288 222 0.1 0.9 0.6
Full Design 265 204 0.4 0.6 0.7
Full Design 334 257 0.3 0.7 0.7
Full Design 424 327 0.2 0.8 0.7
Full Design 567 437 0.1 0.9 0.7
Full Design 655 505 0.4 0.6 0.8
Full Design 825 636 0.3 0.7 0.8
Full Design 1049 809 0.2 0.8 0.8
Full Design 1403 1082 0.1 0.9 0.8

Power analysis per group treatment

survPowerSampleSize(PTD_panel
  ,var = "tumor_type"
  , HR = c(0.5, 0.6, 0.7)
  , power = seq(0.6 , 0.9 , 0.1)
  , alpha = 0.05
  , case.fraction = 0.5
  , tumor.weights = c(brca=brca_tot
                    , luad = luad_tot
                    , lusc = lusc_tot
                    , stad = stad_tot
                    , coadread = coadread_tot
                    )
  )

PATIENT ALLOCATION OPTIMIZATION

Number of patients required for the overall study to reach the required power (using PFS)

Using Progression Free Survival as a primary endpoint.

drugs <- c("HER2 inhibitor"
  , "PARP inhibitor"
  , "AKT inhibitor"
  , "EGFR inhibitor"
  , "FGFR inhibitor"
  , "ALK inhibitor"
  , "BRAF inhibitor"
  , "MET inhibitor"
  , "NOTCH inhibitor"
  , "ALK inhibitor"
  , "Immune Checkpoint Inhibitor")

# Show plot
survPowerSampleSize(PTD_panel
  , HR = c(0.5, 0.6, 0.7, 0.8)
  , power = seq(0.6 , 0.9 , 0.1)
  , alpha = 0.05
  , case.fraction = 0.5
  , priority.trial = drugs 
  , priority.trial.order="optimal"
  , var = "drug"
  , tumor.weights = c(brca=brca_tot
                    , luad = luad_tot
                    , lusc = lusc_tot
                    , stad = stad_tot
                    , coadread = coadread_tot
                    )
  )

Show it in a table

# Show it in a table
survPowerSampleSize(PTD_panel
  , HR = 0.6
  , power = 0.8
  , alpha = 0.05
  , case.fraction = 0.5
  , priority.trial = drugs 
  , priority.trial.order = "optimal"
  , var = "drug"
  , noPlot = TRUE
  , tumor.weights = c(brca = brca_tot
                    , luad = luad_tot
                    , lusc = lusc_tot
                    , stad = stad_tot
                    , coadread = coadread_tot
                    )
  )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : No data for expression. They will be removed from
## alterationType
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## stad, coadread
## 
## Minimum Eligible Sample Size to reach 80% of power with an HR equal to 0.6 and a HR0 equal to 1 for each drug is equal to: 166
## $`HR:0.6 | HR0:1 | Power:0.8`
## $`HR:0.6 | HR0:1 | Power:0.8`$Summary
##              HER2 inhibitor Immune Checkpoint Inhibitor BRAF inhibitor
## Screened               7725                           0              0
## Eligible                208                         271            289
## Not.Eligible           2112                           0              0
##              MET inhibitor EGFR inhibitor ALK inhibitor ALK inhibitor
## Screened                 0              0             0          2168
## Eligible               349            357           470           166
## Not.Eligible             0              0             0           593
##              NOTCH inhibitor PARP inhibitor FGFR inhibitor AKT inhibitor
## Screened                   0              0              0             0
## Eligible                 836           1260           1150          1837
## Not.Eligible               0              0              0             0
##              Total
## Screened      9893
## Eligible      7190
## Not.Eligible  2704
## 
## $`HR:0.6 | HR0:1 | Power:0.8`$Screening.scheme
##                             HER2 inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                        7725                        7559
## Immune Checkpoint Inhibitor              0                           0
## BRAF inhibitor                           0                           0
## MET inhibitor                            0                           0
## EGFR inhibitor                           0                           0
## ALK inhibitor                            0                           0
## ALK inhibitor                         2002                        1961
## NOTCH inhibitor                          0                           0
## PARP inhibitor                           0                           0
## FGFR inhibitor                           0                           0
## AKT inhibitor                            0                           0
##                             BRAF inhibitor MET inhibitor EGFR inhibitor
## HER2 inhibitor                        7342          7111           6836
## Immune Checkpoint Inhibitor              0             0              0
## BRAF inhibitor                           0             0              0
## MET inhibitor                            0             0              0
## EGFR inhibitor                           0             0              0
## ALK inhibitor                            0             0              0
## ALK inhibitor                         1907          1850           1777
## NOTCH inhibitor                          0             0              0
## PARP inhibitor                           0             0              0
## FGFR inhibitor                           0             0              0
## AKT inhibitor                            0             0              0
##                             ALK inhibitor ALK inhibitor NOTCH inhibitor
## HER2 inhibitor                       6549          6080            6080
## Immune Checkpoint Inhibitor             0             0               0
## BRAF inhibitor                          0             0               0
## MET inhibitor                           0             0               0
## EGFR inhibitor                          0             0               0
## ALK inhibitor                           0             0               0
## ALK inhibitor                        1707          2168            1707
## NOTCH inhibitor                         0             0               0
## PARP inhibitor                          0             0               0
## FGFR inhibitor                          0             0               0
## AKT inhibitor                           0             0               0
##                             PARP inhibitor FGFR inhibitor AKT inhibitor
## HER2 inhibitor                        5427           4444          3546
## Immune Checkpoint Inhibitor              0              0             0
## BRAF inhibitor                           0              0             0
## MET inhibitor                            0              0             0
## EGFR inhibitor                           0              0             0
## ALK inhibitor                            0              0             0
## ALK inhibitor                         1523           1248           996
## NOTCH inhibitor                          0              0             0
## PARP inhibitor                           0              0             0
## FGFR inhibitor                           0              0             0
## AKT inhibitor                            0              0             0
## 
## $`HR:0.6 | HR0:1 | Power:0.8`$Allocation.scheme
##                             HER2 inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                         166                         218
## Immune Checkpoint Inhibitor              0                           0
## BRAF inhibitor                           0                           0
## MET inhibitor                            0                           0
## EGFR inhibitor                           0                           0
## ALK inhibitor                            0                           0
## ALK inhibitor                           42                          54
## NOTCH inhibitor                          0                           0
## PARP inhibitor                           0                           0
## FGFR inhibitor                           0                           0
## AKT inhibitor                            0                           0
## Total                                  208                         271
##                             BRAF inhibitor MET inhibitor EGFR inhibitor
## HER2 inhibitor                         231           276            287
## Immune Checkpoint Inhibitor              0             0              0
## BRAF inhibitor                           0             0              0
## MET inhibitor                            0             0              0
## EGFR inhibitor                           0             0              0
## ALK inhibitor                            0             0              0
## ALK inhibitor                           58            73             71
## NOTCH inhibitor                          0             0              0
## PARP inhibitor                           0             0              0
## FGFR inhibitor                           0             0              0
## AKT inhibitor                            0             0              0
## Total                                  289           349            357
##                             ALK inhibitor ALK inhibitor NOTCH inhibitor
## HER2 inhibitor                        470             0             653
## Immune Checkpoint Inhibitor             0             0               0
## BRAF inhibitor                          0             0               0
## MET inhibitor                           0             0               0
## EGFR inhibitor                          0             0               0
## ALK inhibitor                           0             0               0
## ALK inhibitor                           0           166             184
## NOTCH inhibitor                         0             0               0
## PARP inhibitor                          0             0               0
## FGFR inhibitor                          0             0               0
## AKT inhibitor                           0             0               0
## Total                                 470           166             836
##                             PARP inhibitor FGFR inhibitor AKT inhibitor
## HER2 inhibitor                         984            898          1435
## Immune Checkpoint Inhibitor              0              0             0
## BRAF inhibitor                           0              0             0
## MET inhibitor                            0              0             0
## EGFR inhibitor                           0              0             0
## ALK inhibitor                            0              0             0
## ALK inhibitor                          276            252           403
## NOTCH inhibitor                          0              0             0
## PARP inhibitor                           0              0             0
## FGFR inhibitor                           0              0             0
## AKT inhibitor                            0              0             0
## Total                                 1260           1150          1837
## 
## $`HR:0.6 | HR0:1 | Power:0.8`$Probability.scheme
##                             HER2 inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                  0.02148967                  0.02878465
## Immune Checkpoint Inhibitor     0.01831897                  0.03192155
## BRAF inhibitor                  0.02220785                  0.00000000
## MET inhibitor                   0.02197085                  0.00000000
## EGFR inhibitor                  0.02176752                  0.00000000
## ALK inhibitor                   0.02078626                  0.00000000
## ALK inhibitor                   0.02078626                  0.02722658
## NOTCH inhibitor                 0.00000000                  0.00000000
## PARP inhibitor                  0.00000000                  0.00000000
## FGFR inhibitor                  0.00000000                  0.00000000
## AKT inhibitor                   0.00000000                  0.00000000
##                             BRAF inhibitor MET inhibitor EGFR inhibitor
## HER2 inhibitor                  0.03139407    0.03875793     0.04197123
## Immune Checkpoint Inhibitor     0.00000000    0.00000000     0.00000000
## BRAF inhibitor                  0.03233883    0.00000000     0.00000000
## MET inhibitor                   0.00000000    0.04089297     0.00000000
## EGFR inhibitor                  0.00000000    0.00000000     0.04151888
## ALK inhibitor                   0.00000000    0.00000000     0.00000000
## ALK inhibitor                   0.03036053    0.03938356     0.03947033
## NOTCH inhibitor                 0.00000000    0.00000000     0.00000000
## PARP inhibitor                  0.00000000    0.00000000     0.00000000
## FGFR inhibitor                  0.00000000    0.00000000     0.00000000
## AKT inhibitor                   0.00000000    0.00000000     0.00000000
##                             ALK inhibitor ALK inhibitor NOTCH inhibitor
## HER2 inhibitor                 0.07162195       0.00000       0.1073701
## Immune Checkpoint Inhibitor    0.00000000       0.00000       0.0000000
## BRAF inhibitor                 0.00000000       0.00000       0.0000000
## MET inhibitor                  0.00000000       0.00000       0.0000000
## EGFR inhibitor                 0.00000000       0.00000       0.0000000
## ALK inhibitor                  0.07657000       0.00000       0.0000000
## ALK inhibitor                  0.00000000       0.07657       0.1073701
## NOTCH inhibitor                0.00000000       0.00000       0.0000000
## PARP inhibitor                 0.00000000       0.00000       0.0000000
## FGFR inhibitor                 0.00000000       0.00000       0.0000000
## AKT inhibitor                  0.00000000       0.00000       0.0000000
##                             PARP inhibitor FGFR inhibitor AKT inhibitor
## HER2 inhibitor                   0.1811702      0.2020312     0.4045455
## Immune Checkpoint Inhibitor      0.0000000      0.0000000     0.0000000
## BRAF inhibitor                   0.0000000      0.0000000     0.0000000
## MET inhibitor                    0.0000000      0.0000000     0.0000000
## EGFR inhibitor                   0.0000000      0.0000000     0.0000000
## ALK inhibitor                    0.0000000      0.0000000     0.0000000
## ALK inhibitor                    0.1811702      0.2020312     0.4045455
## NOTCH inhibitor                  0.0000000      0.0000000     0.0000000
## PARP inhibitor                   0.0000000      0.0000000     0.0000000
## FGFR inhibitor                   0.0000000      0.0000000     0.0000000
## AKT inhibitor                    0.0000000      0.0000000     0.0000000
## 
## $`HR:0.6 | HR0:1 | Power:0.8`$Base.probabilities
##              HER2 inhibitor Immune Checkpoint Inhibitor 
##                  0.02148967                  0.03192155 
##              BRAF inhibitor               MET inhibitor 
##                  0.03233883                  0.04089297 
##              EGFR inhibitor               ALK inhibitor 
##                  0.04151888                  0.07657000 
##               ALK inhibitor             NOTCH inhibitor 
##                  0.07657000                  0.11600250 
##              PARP inhibitor              FGFR inhibitor 
##                  0.17275193                  0.21301899 
##               AKT inhibitor 
##                  0.34759024

Power analysis per group treatment with HR 0.6

was remove before to not make plot out of scale

survPowerSampleSize(
  PTD_panel
  , var = "tumor_type"
  , HR = c(0.5, 0.6, 0.7, 0.8)
  , power = seq(0.6 , 0.9 , 0.1)
  , alpha = 0.05
  , case.fraction = 0.5
  )

HR 0.5

priordrugs <- survPowerSampleSize(
  PTD_panel
  , var = "drug"
  , priority.trial = drugs 
  , priority.trial.order="optimal"
  , HR = 0.5
  , power = 0.8
  )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : No data for expression. They will be removed from
## alterationType
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## stad, coadread
priordrugs
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?

HR 0.6

priordrugs <- survPowerSampleSize(PTD_panel
  , var = "drug"
  , priority.trial = drugs 
  , priority.trial.order="optimal"
  , HR = 0.6
  , power = 0.8
  )
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : No data for expression. They will be removed from
## alterationType
## Warning in dataExtractor(object = object, alterationType =
## alterationType, : The following tumor types have no alteration to display:
## stad, coadread
priordrugs
## geom_path: Each group consists of only one observation. Do you need to
## adjust the group aesthetic?

extra

Number of patients to be recruited to reach power
propPowerSampleSize(PTD_panel
  , noPlot=FALSE
  , alterationType = c("mutations", "copynumber", "expression")
  , pCase = c(0.2, 0.3 , 0.4)
  , pControl = rep(0.1, 3)
  #, power =c(0.7, 0.75, 0.8, 0.85, 0.9)
  , power = c(0.7, 0.8, 0.9)
  , alpha= 0.1
  , side = 1
  ) 

propPowerSampleSize(PTD_panel
  , var = "drug"
  , alterationType = c("mutations", "copynumber")
  , priority.trial = as.character(unique(panel_design$drug))[-4] 
  , priority.trial.order="optimal"
  #, HR = 0.66
  #, p.event=1
  , noPlot=TRUE
  , pCase = 0.3
  , pControl = 0.1
  , side =1
  , alpha= 0.1
  , power =0.8
  , case.fraction = 0.6
  )
## $`pCase:0.3 | pControl:0.1 | Power:0.8`
## $`pCase:0.3 | pControl:0.1 | Power:0.8`$Summary
##              HER2 inhibitor EGFR inhibitor BRAF inhibitor MET inhibitor
## Screened                571              0             15             0
## Eligible                 22             25             21            24
## Not.Eligible            183              0              5             0
##              Immune Checkpoint Inhibitor ALK inhibitor NOTCH inhibitor
## Screened                             108             0               0
## Eligible                              18            34              58
## Not.Eligible                          35             0               0
##              PARP inhibitor FGFR inhibitor AKT inhibitor Total
## Screened                  0              0             0   694
## Eligible                 84             68           122   472
## Not.Eligible              0              0             0   222
## 
## $`pCase:0.3 | pControl:0.1 | Power:0.8`$Screening.scheme
##                             HER2 inhibitor EGFR inhibitor BRAF inhibitor
## HER2 inhibitor                         571            553            533
## EGFR inhibitor                           0              0              0
## BRAF inhibitor                          14             14             15
## MET inhibitor                            0              0              0
## Immune Checkpoint Inhibitor            103            101             97
## ALK inhibitor                            0              0              0
## NOTCH inhibitor                          0              0              0
## PARP inhibitor                           0              0              0
## FGFR inhibitor                           0              0              0
## AKT inhibitor                            0              0              0
##                             MET inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                        515                         496
## EGFR inhibitor                          0                           0
## BRAF inhibitor                         14                          13
## MET inhibitor                           0                           0
## Immune Checkpoint Inhibitor            95                         108
## ALK inhibitor                           0                           0
## NOTCH inhibitor                         0                           0
## PARP inhibitor                          0                           0
## FGFR inhibitor                          0                           0
## AKT inhibitor                           0                           0
##                             ALK inhibitor NOTCH inhibitor PARP inhibitor
## HER2 inhibitor                        483             455            407
## EGFR inhibitor                          0               0              0
## BRAF inhibitor                         13              12             11
## MET inhibitor                           0               0              0
## Immune Checkpoint Inhibitor            91              86             77
## ALK inhibitor                           0               0              0
## NOTCH inhibitor                         0               0              0
## PARP inhibitor                          0               0              0
## FGFR inhibitor                          0               0              0
## AKT inhibitor                           0               0              0
##                             FGFR inhibitor AKT inhibitor
## HER2 inhibitor                         338           283
## EGFR inhibitor                           0             0
## BRAF inhibitor                           9             8
## MET inhibitor                            0             0
## Immune Checkpoint Inhibitor             64            54
## ALK inhibitor                            0             0
## NOTCH inhibitor                          0             0
## PARP inhibitor                           0             0
## FGFR inhibitor                           0             0
## AKT inhibitor                            0             0
## 
## $`pCase:0.3 | pControl:0.1 | Power:0.8`$Allocation.scheme
##                             HER2 inhibitor EGFR inhibitor BRAF inhibitor
## HER2 inhibitor                          18             21             18
## EGFR inhibitor                           0              0              0
## BRAF inhibitor                           1              1              1
## MET inhibitor                            0              0              0
## Immune Checkpoint Inhibitor              3              4              3
## ALK inhibitor                            0              0              0
## NOTCH inhibitor                          0              0              0
## PARP inhibitor                           0              0              0
## FGFR inhibitor                           0              0              0
## AKT inhibitor                            0              0              0
## Total                                   22             25             21
##                             MET inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                         20                          14
## EGFR inhibitor                          0                           0
## BRAF inhibitor                          1                           1
## MET inhibitor                           0                           0
## Immune Checkpoint Inhibitor             4                           5
## ALK inhibitor                           0                           0
## NOTCH inhibitor                         0                           0
## PARP inhibitor                          0                           0
## FGFR inhibitor                          0                           0
## AKT inhibitor                           0                           0
## Total                                  24                          18
##                             ALK inhibitor NOTCH inhibitor PARP inhibitor
## HER2 inhibitor                         28              48             69
## EGFR inhibitor                          0               0              0
## BRAF inhibitor                          1               2              2
## MET inhibitor                           0               0              0
## Immune Checkpoint Inhibitor             6               9             13
## ALK inhibitor                           0               0              0
## NOTCH inhibitor                         0               0              0
## PARP inhibitor                          0               0              0
## FGFR inhibitor                          0               0              0
## AKT inhibitor                           0               0              0
## Total                                  34              58             84
##                             FGFR inhibitor AKT inhibitor
## HER2 inhibitor                          56           101
## EGFR inhibitor                           0             0
## BRAF inhibitor                           2             3
## MET inhibitor                            0             0
## Immune Checkpoint Inhibitor             11            19
## ALK inhibitor                            0             0
## NOTCH inhibitor                          0             0
## PARP inhibitor                           0             0
## FGFR inhibitor                           0             0
## AKT inhibitor                            0             0
## Total                                   68           122
## 
## $`pCase:0.3 | pControl:0.1 | Power:0.8`$Probability.scheme
##                             HER2 inhibitor EGFR inhibitor BRAF inhibitor
## HER2 inhibitor                  0.03153153     0.03720930     0.03274289
## EGFR inhibitor                  0.03069719     0.03803804     0.00000000
## BRAF inhibitor                  0.02968750     0.03274289     0.03903904
## MET inhibitor                   0.03131524     0.00000000     0.00000000
## Immune Checkpoint Inhibitor     0.02716823     0.03276047     0.02942810
## ALK inhibitor                   0.00000000     0.00000000     0.00000000
## NOTCH inhibitor                 0.00000000     0.00000000     0.00000000
## PARP inhibitor                  0.00000000     0.00000000     0.00000000
## FGFR inhibitor                  0.00000000     0.00000000     0.00000000
## AKT inhibitor                   0.00000000     0.00000000     0.00000000
##                             MET inhibitor Immune Checkpoint Inhibitor
## HER2 inhibitor                 0.03829079                  0.02654357
## EGFR inhibitor                 0.00000000                  0.00000000
## BRAF inhibitor                 0.03829079                  0.02654357
## MET inhibitor                  0.04104104                  0.00000000
## Immune Checkpoint Inhibitor    0.03489703                  0.04204204
## ALK inhibitor                  0.00000000                  0.00000000
## NOTCH inhibitor                0.00000000                  0.00000000
## PARP inhibitor                 0.00000000                  0.00000000
## FGFR inhibitor                 0.00000000                  0.00000000
## AKT inhibitor                  0.00000000                  0.00000000
##                             ALK inhibitor NOTCH inhibitor PARP inhibitor
## HER2 inhibitor                 0.05749852       0.1050314      0.1693605
## EGFR inhibitor                 0.00000000       0.0000000      0.0000000
## BRAF inhibitor                 0.05749852       0.1050314      0.1693605
## MET inhibitor                  0.00000000       0.0000000      0.0000000
## Immune Checkpoint Inhibitor    0.05749852       0.1050314      0.1693605
## ALK inhibitor                  0.00000000       0.0000000      0.0000000
## NOTCH inhibitor                0.00000000       0.0000000      0.0000000
## PARP inhibitor                 0.00000000       0.0000000      0.0000000
## FGFR inhibitor                 0.00000000       0.0000000      0.0000000
## AKT inhibitor                  0.00000000       0.0000000      0.0000000
##                             FGFR inhibitor AKT inhibitor
## HER2 inhibitor                   0.1641286      0.354251
## EGFR inhibitor                   0.0000000      0.000000
## BRAF inhibitor                   0.1641286      0.354251
## MET inhibitor                    0.0000000      0.000000
## Immune Checkpoint Inhibitor      0.1641286      0.354251
## ALK inhibitor                    0.0000000      0.000000
## NOTCH inhibitor                  0.0000000      0.000000
## PARP inhibitor                   0.0000000      0.000000
## FGFR inhibitor                   0.0000000      0.000000
## AKT inhibitor                    0.0000000      0.000000
## 
## $`pCase:0.3 | pControl:0.1 | Power:0.8`$Base.probabilities
##              HER2 inhibitor              EGFR inhibitor 
##                  0.03153153                  0.03803804 
##              BRAF inhibitor               MET inhibitor 
##                  0.03903904                  0.04104104 
## Immune Checkpoint Inhibitor               ALK inhibitor 
##                  0.04204204                  0.07807808 
##             NOTCH inhibitor              PARP inhibitor 
##                  0.12312312                  0.18718719 
##              FGFR inhibitor               AKT inhibitor 
##                  0.18918919                  0.33633634
surv2 <- survPowerSampleSize(PTD_panel
   , alterationType = c("mutations", "copynumber")
   , HR = 0.66
   , power = 0.8
   , alpha = 0.05
   , case.fraction = 0.5
   , ber=0.85
   , fu=1.883
   #, priority.trial.order="as.is"
   , priority.trial.order="optimal"
   , var = "drug" 
   , noPlot=TRUE)
kable(surv2 , row.names=FALSE)
Var ScreeningSampleSize EligibleSampleSize Beta Power HazardRatio
AKT inhibitor 747 251 0.2 0.8 0.66
ALK inhibitor 3215 251 0.2 0.8 0.66
BRAF inhibitor 6430 251 0.2 0.8 0.66
EGFR inhibitor 6599 251 0.2 0.8 0.66
FGFR inhibitor 1327 251 0.2 0.8 0.66
HER2 inhibitor 7961 251 0.2 0.8 0.66
Immune Checkpoint Inhibitor 5971 251 0.2 0.8 0.66
MET inhibitor 6116 251 0.2 0.8 0.66
no_drug 1283 251 0.2 0.8 0.66
NOTCH inhibitor 2039 251 0.2 0.8 0.66
PARP inhibitor 1341 251 0.2 0.8 0.66
Full Design 335 251 0.2 0.8 0.66

Per abstract

NOT OPTIMAL

set.seed(111)
# NOT optimal
surv2 <- survPowerSampleSize(PTD_panel
   , alterationType = c("mutations", "copynumber")
   , HR = 0.66
   , power = 0.8
   , alpha = 0.05
   , case.fraction = 0.5
   , ber=0.85
   , fu=1.883
   , var = "drug"
   , tumor.weights = c(brca=brca_tot
                               , luad=luad_tot
                               , lusc=lusc_tot
                               , stad = stad_tot
                               , coadread = coadread_tot
                               )
   , noPlot=TRUE)

#export
#write.table(surv2, file = "~/Desktop/notoptimal_ptd-showcase.txt", quote=FALSE, sep=",")

# count n patients necessary to be recruited
n_patients_notoptimal <- surv2  %>% 
  dplyr::filter(!Var == "no_drug", !Var == "Full Design") %>%
  dplyr::select(ScreeningSampleSize) %>%
  dplyr::summarise_all(sum)

#preview
kable(surv2 , row.names=FALSE)
Var ScreeningSampleSize EligibleSampleSize Beta Power HazardRatio
AKT inhibitor 775 251 0.2 0.8 0.66
ALK inhibitor 3022 251 0.2 0.8 0.66
BRAF inhibitor 4998 251 0.2 0.8 0.66
EGFR inhibitor 5797 251 0.2 0.8 0.66
FGFR inhibitor 1467 251 0.2 0.8 0.66
HER2 inhibitor 7712 251 0.2 0.8 0.66
Immune Checkpoint Inhibitor 5394 251 0.2 0.8 0.66
MET inhibitor 5720 251 0.2 0.8 0.66
no_drug 987 251 0.2 0.8 0.66
NOTCH inhibitor 2200 251 0.2 0.8 0.66
PARP inhibitor 1546 251 0.2 0.8 0.66
Full Design 328 251 0.2 0.8 0.66
  • Number of patients necessary: 3.863110^{4}

Optimal

library(parallel)
set.seed(111)
simulSurv2 <- mclapply(1:100 , function(x) {
    survPowerSampleSize(PTD_panel
        , alterationType = c("mutations", "copynumber")
        , HR = 0.625
        , power = 0.8
        , alpha = 0.05
        , ber=0.85
        , fu=1.883
        , case.fraction = 0.5
        , collapseByGene=TRUE
        #, tumor.weights = shivapop$Samples_n %>% 
        #                setNames(shivapop$tcga_id) 
        , tumor.weights = c(brca=brca_tot
                               , luad=luad_tot
                               , lusc=lusc_tot
                               , stad = stad_tot
                               , coadread = coadread_tot
                               )
        , var = "drug" 
        , noPlot=TRUE
        , priority.trial=drugs
        , priority.trial.order="optimal")$`HR:0.625 | HR0:1 | Power:0.8`$Summary
} , mc.cores=detectCores())
summaryMat2 <- simulSurv2[[1]]
for(i in rownames(summaryMat2)){
    for(j in colnames(summaryMat2)){
        vec <- sapply(simulSurv2 , function(x) x[i , j])
        summaryMat2[i , j] <- paste(mean(vec) , 
                paste0( "(" , quantile(vec , 0.025) 
                        , "-" 
                        , quantile(vec , 0.975) , ")"))
    }
}

#save
#write.table(summaryMat2, file = "~/Desktop/optimal_ptd-showcase.txt", quote=FALSE, sep=",")
#preview
kable(summaryMat2)
HER2 inhibitor Immune Checkpoint Inhibitor MET inhibitor EGFR inhibitor BRAF inhibitor ALK inhibitor ALK inhibitor NOTCH inhibitor FGFR inhibitor PARP inhibitor AKT inhibitor Total
Screened 6772.57 (6072.825-7487.525) 220.13 (0-952.9) 12.68 (0-185.025) 0 (0-0) 0 (0-0) 0 (0-0) 2212 0 (0-0) 0 (0-0) 0 (0-0) 0 (0-0) 9363.9 (8696.4-9975.5)
Eligible 263.9 (251.475-286) 270.09 (245-321.675) 317.73 (263.9-374.625) 339.8 (302.95-378.1) 325.91 (287.85-361.575) 382.6 (328.225-440.3) 199 647.38 (571.8-721.3) 838.53 (765.375-959.05) 967.72 (779.65-1089.975) 1619.54 (1494.85-1769.35) 6167.86 (5698.6-6567.2)
Not.Eligible 2312.25 (2037.9-2548.4) 75.2 (0-328.45) 4.36 (0-62.2499999999999) 0 (0-0) 0 (0-0) 0 (0-0) 760 0 (0-0) 0 (0-0) 0 (0-0) 0 (0-0) 3196.51 (2894.9-3465)

Session info

For reproducibility purpose:

sessionInfo()
## R version 3.3.3 (2017-03-06)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: macOS Sierra 10.12.5
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## attached base packages:
## [1] parallel  stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
## [1] gdtools_0.1.4                 svglite_1.2.0                
## [3] PrecisionTrialDesigner_0.99.0 ggplot2_2.2.1.9000           
## [5] knitr_1.15.1                  DT_0.2                       
## 
## loaded via a namespace (and not attached):
##  [1] ggrepel_0.6.5                 Rcpp_0.12.10                 
##  [3] LowMACAAnnotation_0.99.3      tidyr_0.6.1                  
##  [5] Rsamtools_1.24.0              Biostrings_2.40.2            
##  [7] gtools_3.5.0                  assertthat_0.1               
##  [9] rprojroot_1.2                 digest_0.6.12                
## [11] mime_0.5                      R6_2.2.0                     
## [13] GenomeInfoDb_1.8.7            plyr_1.8.4                   
## [15] backports_1.0.5               stats4_3.3.3                 
## [17] RSQLite_1.1-2                 evaluate_0.10                
## [19] httr_1.2.1                    cgdsr_1.2.5                  
## [21] highr_0.6                     BiocInstaller_1.24.0         
## [23] zlibbioc_1.18.0               lazyeval_0.2.0               
## [25] data.table_1.10.0             gdata_2.17.0                 
## [27] googleVis_0.6.2               S4Vectors_0.10.3             
## [29] R.oo_1.21.0                   rmarkdown_1.4                
## [31] labeling_0.3                  BiocParallel_1.6.6           
## [33] AnnotationHub_2.6.5           stringr_1.2.0                
## [35] htmlwidgets_0.8               RCurl_1.95-4.8               
## [37] biomaRt_2.30.0                munsell_0.4.3                
## [39] shiny_1.0.0                   httpuv_1.3.3                 
## [41] rtracklayer_1.32.2            BiocGenerics_0.20.0          
## [43] htmltools_0.3.5               SummarizedExperiment_1.2.3   
## [45] tibble_1.3.0                  interactiveDisplayBase_1.12.0
## [47] IRanges_2.6.1                 codetools_0.2-15             
## [49] XML_3.98-1.5                  dplyr_0.5.0                  
## [51] GenomicAlignments_1.8.4       shinyBS_0.61                 
## [53] bitops_1.0-6                  R.methodsS3_1.7.1            
## [55] grid_3.3.3                    jsonlite_1.3                 
## [57] xtable_1.8-2                  gtable_0.2.0                 
## [59] DBI_0.6                       magrittr_1.5                 
## [61] scales_0.4.1                  stringi_1.1.3                
## [63] XVector_0.12.1                reshape2_1.4.2               
## [65] RColorBrewer_1.1-2            tools_3.3.3                  
## [67] Biobase_2.34.0                yaml_2.1.14                  
## [69] AnnotationDbi_1.36.2          colorspace_1.3-2             
## [71] GenomicRanges_1.24.3          memoise_1.0.0

  1. Frequency is calculated on the the selected population for the study (i.e. frequency sum = 1) and not on the overall cancer population that includes all tumor types.

  2. Frequency is calculated on the the selected population for the study (i.e. frequency sum = 1) and not on the overall cancer population that includes all tumor types.